package midas.mw;


/**
 * Defines a middleware controlled running component. Used to keep middleware 
 * informed about its controlled running components and to be able to both
 * request and terminate the components.<p>
 * NOTE: Implementation and its appliance is not complete/errorfree.<p>
 * NOTE: Only one component instance of each class
 */
public class MwRunningComponent {
	
	/**The unique id of the thread */
	private String threadName;
	
	/**Starting class binary name */
	private String compClassName;
	
	/**Starting class arguments */
	private String[] args;
	
	/** The thread */
	private Thread thread;
	
	/** The running object */
	private Object obj;
	
	/**
	 * Constructor - set specified parameter values
	 * @param compClassName The main class name for the component
	 * @param method The name of the method to be invoked when starting the component
	 * @param args The set of arguments to follow the method invocation
	 * @param threadId The started component thread identifier
	 * @param thread The started comonent's thread
	 */
	public MwRunningComponent(String compClassName, String[] args, String threadName, Thread thread) {
		this.compClassName = compClassName;
		this.args = args;
		this.threadName = threadName;
		this.thread = thread;
		this.obj = null;
	}
	
	public String getCompClassName() {
		return compClassName;
	}

	public String[] getArgs() {
		return args;
	}
	
	public String getThreadName() {
		return this.threadName;
	}
	
	public Thread getThread() {
		return this.thread;
	}
	
	public void setObject(Object obj) {
		this.obj = obj;
	}
	
	public Object getObject() {
		return obj;
	}
}
